Return the changed path as an argument to the watch callback. This is useful
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 21 Nov 2005 17:33:17 +0000 (18:33 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Mon, 21 Nov 2005 17:33:17 +0000 (18:33 +0100)
for the test CD, and simplifies DevController everso slightly.  It ought to be
generally useful, too.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/server/DevController.py
tools/python/xen/xend/xenstore/xswatch.py

index 389e6114a36a973698087885c1385f7a6b1451be..b70ae2f8b478e8bed00121e288213f7026110d28 100644 (file)
@@ -114,7 +114,7 @@ class XendDomain:
 
     ## private:
 
-    def onReleaseDomain(self):
+    def onReleaseDomain(self, _):
         self.domains_lock.acquire()
         try:
             self.refresh()
index 907c0b187585a7be7ab009f3d00687b86f505a5c..e6e6a2e7d06723ad9528a8198eccacb8952f9232 100644 (file)
@@ -424,7 +424,7 @@ class XendDomainInfo:
             return []
 
 
-    def storeChanged(self):
+    def storeChanged(self, _):
         log.trace("XendDomainInfo.storeChanged");
 
         changed = False
index 36226d7c9adcbafc31da46f432035d63a5300f96..4bb8642226ad02da51cb3818a4c9a8837caeaa06 100644 (file)
@@ -328,7 +328,7 @@ class DevController:
             ev = Event()
             result = { 'status': Timeout }
             
-            xswatch(statusPath, hotplugStatusCallback, statusPath, ev, result)
+            xswatch(statusPath, hotplugStatusCallback, ev, result)
 
             ev.wait(DEVICE_CREATE_TIMEOUT)
             return result['status']
index 0f8b60d8b8f90f312bd9eeef489aee362f06315b..8b8bb2d087a42835ed6c71c72ec3466a0db74541 100644 (file)
@@ -51,7 +51,7 @@ def watchMain():
         try:
             we = xs.read_watch()
             watch = we[1]
-            res = watch.fn(*watch.args, **watch.kwargs)
+            res = watch.fn(we[0], *watch.args, **watch.kwargs)
             if not res:
                 watch.unwatch()
         except: